<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>社保查询</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" href="../../plugins/mui/mui.min.css">
	<link rel="stylesheet" href="../../css/life_housekeeper/wate_index.css" />
	<script src="../../js/statistics.js"></script>
	<script src="../../js/fontset.js"></script>
	<style>
		.content {
			padding: .54rem .15rem 0;
		}
		label.search-label{
			width: auto;
			margin-right: .05rem;
		}
		.group-bg-box.social-bg{
			background-image: url(../../images/icon/index/social-bg.png);
			background-repeat: no-repeat;
			background-size: 100%;
			height: 1.4rem;
			position: relative;
			margin-top: -.24rem;
		}
		.group-bg-box.social-bg .search-group{
			padding-top: inherit;
		}
		.security-bg{
			margin:0 .08rem ;
			background-image:url(../../images/icon/index/social-bg1.png) ;
			background-size: 100%;
			height: 1.78rem;

		}
		.social-bg input.input-defalut:focus{
			text-align: center;
		}
	</style>
</head>
<body>
<header class="mui-bar mui-bar-nav header">
	<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	<h1 class="mui-title">社保查询</h1>
</header>
<div class="mui-content content-vh">
	<div class="content">
		<div class="security-bg"></div>
		<div class="group-bg-box social-bg" >
			<div class="search-group ">
				<div class="query-table-view-cell">
					<span class="query-cell-tit">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</span>
					<input type="text" placeholder="请输入姓名" class="query-input input-defalut" id="user" readonly="readonly"/>
				</div>
				<div class="query-table-view-cell">
					<span class="query-cell-tit">身份证号：</span>
					<input type="text" placeholder="请输入身份证号" class="query-input input-defalut" id="card" readonly="readonly"/>
				</div>
			</div>
		</div>
		<div class="btn-box">
			<button class="button-primary" id="searchBtn">查询</button>
		</div>

	</div>
</div>

<script type="text/javascript" src="../../plugins/jquery/jquery-3.1.0.min.js"></script>
<script src="../../plugins/mui/mui.min.js"></script>
<!--<script type="text/javascript" src="../plugins/mui/update.js"></script>-->
<script src="../../js/getApiToken.js"></script>
<script src="../../js/md5.js"></script>
<script src="../../js/life_housekeeper/windowTitleView.js"></script>
<script src="../../js/my/security/index.js" ></script>
<script type="text/javascript">
	mui.init();
	mui.plusReady(function(){
		
		certification(securityLogin);
		//securityLogin();
	})
	
	
	function securityLogin(){
		myAjax('login/front_user/getCard','post',{
			'userId': plus.storage.getItem('cg_user_id')	
		},function(e){
			//console.log(JSON.stringify(e));
			if(e.code == '0'){
				var data = e.data,
				searchBtn = document.getElementById('searchBtn'),
				user = document.getElementById("user"),
				card = document.getElementById("card");
				user.value = replaceStr(data.true_name);
				card.value = replaceStr(data.creadit_card,5,2);
				searchBtn.addEventListener('tap',function(){
					var viewOptions = {
						url:'security-check.html',
						id:'security-check'
					},
					extras ={},
					titleOptions = {
						title:'类型选择',
						backImg:'whiteBack'
					};
					addTitleView(viewOptions,extras,titleOptions);
				},false)
			}else{
				mui.toast(e.message);
				return;
			}
		})
		
		
	}
	
	
	//社保查询
	function socialSearch(){
		var searchBtn = document.getElementById('searchBtn'),
				user = document.getElementById("user"),
				card = document.getElementById("card");
		searchBtn.addEventListener('tap',function(){
			var userValue = user.value,
					cardValue = card.value;
			if(!userValue || userValue==""){
				mui.toast("请输入姓名!");
				return;
			}else{
				var reg = new RegExp("^[\u4e00-\u9fa5]+(·[\u4e00-\u9fa5]+)*$");
				if(!reg.test(userValue)){
					mui.toast("请输入正确的姓名!");
					return;
				}
			}
			if(!cardValue || cardValue == ''){
				mui.toast("请输入身份证号!");
				return;
			}else{
				if(!validateIdCard(cardValue)){
					return;
				}
				
			}
		},false)
	}
</script>
</body>
</html>

